{% extends 'layout.html' %}

{% block content %}

    <div class="luffy-container">
        <div class="btn-group" style="margin: 5px 0">
            <a class="btn btn-default" href="/asset/add/">
                <i class="fa fa-plus-square" aria-hidden="true"></i> 添加资产
            </a>
            <a class="btn btn-default" href="/asset/import/">
                <i class="fa fa-file-excel-o" aria-hidden="true"></i> 批量导入
            </a>
            <div class="right" style="margin-left: 911px" >
                <form method="get" action="{% url 'search' %}">
{#                  {% csrf_token %}#}
                  <input name="q"  type="search" placeholder="请输入姓名" required>
                  <button type="submit">搜索</button>
                </form>

            </div>

        </div>

        <table class="table table-bordered table-hover">
            <thead>
            <tr>
                <th>ID</th>
                <th>品牌</th>
                <th>型号</th>
                <th>编号</th>
                <th>领用时间</th>
                <th>领用人</th>
                <th>归还时间</th>
                <th>备注</th>
                <th>编辑</th>

            </tr>
            </thead>
            <tbody>
            {% if error_msg %}
                <p>{{ error_msg }}</p>
            {% endif %}
            {% for row in post_list %}
                <tr>
                    <td>{{ row.id }}</td>
                    <td>{{ row.brand }}</td>
                    <td>{{ row.model }}</td>
                    <td>{{ row.number }}</td>
                    <td>{{ row.leader_time|date:"Y-m-d" }}</td>
                    <td>{{ row.leader }}</td>
                    <td>{{ row.return_time|date:"Y-m-d" }}</td>
                    <td>{{ row.other }}</td>

                    <td>
                        <a style="color: #333333;" href="/asset/edit/{{ row.id }}/">
                            <i class="fa fa-edit" aria-hidden="true"></i></a>
                        |
                        <a style="color: #d9534f;" href="/asset/del/{{ row.id }}/"><i class="fa fa-trash-o"></i></a>
                    </td>

                </tr>
                {% empty %}
                    <div class="no-post">
                        <span class="font-16" style="color: red" >没有搜索到符合条件的人员</span>
                    </div>
            {% endfor %}
            </tbody>
        </table>
    {{ page_html|safe }}
    </div>
{% endblock %}